package router

import (
	platformController "gitee.com/wangshh_123/cross-pay-go/src/controller/platform"
	"gitee.com/wangshh_123/cross-pay-go/src/middleware"
	"github.com/gin-gonic/gin"
)

// SetupCardHistoryRouter 设置统一的卡历史路由
func SetupCardHistoryRouter(api *gin.RouterGroup) {
	cardHistoryController := platformController.NewCardHistoryController()

	// 卡历史相关路由
	cardHistory := api.Group("/card-history")
	{
		// 基础卡历史查询 - 根据用户平台自动选择
		cardHistory.GET("/", middleware.AuthMiddleware(), middleware.PlatformInfoMiddleware(), cardHistoryController.GetCardHistoryList)

		// 管理员指定平台查询
		cardHistory.GET("/:platform", middleware.AuthMiddleware(), middleware.AdminMiddleware(), cardHistoryController.GetCardHistoryListByPlatform)
	}
}
